home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
NOVA - For the NeXT Workstation
/
NOVA - For the NeXT Workstation.iso
/
SourceCode
/
AdobeExamples
/
NX_Clock
/
README
< prev
Wrap
Text File
|
1992-12-19
|
2KB
|
44 lines
README file for the Clock application.
The Clock application looks at graphic state objects (gstates) and user objects.
This is done within the context of a clock. The hands of the clock each have a
gstate associated with them. The gstates and the path descriptions for the hands
are referenced using user objects. (The paths are stored in the server.) Although
the use of a gstate for each hand of the clock is a little gratuitous, the setup does
provide a closer look at how gstates work.
Gstates are primarily useful for windows and views that will be composited onto
other views. The reason for this is because a gstate contains a reference to the
device. The device for a window is the raster memory. As a result, the gstate
provides a way to focus the drawing on a particular area in raster memory. (The
composite operator uses the gstate to locate the raster image for the source.)
Gstates also provide an easy way to install an arbitrary graphic state as the
current graphic state instead of having to set each parameter explicitly.
Below lies an annotated list of the files used in the application.
Animator - A subclass of Object taken from the StopWatch application
that was once in the NeXTDeveloper directory. It provides
the call backs for the one second ticks.
ClockApp - A subclass of Application that creates the clock window.
ClockView - A subclass of View that manages the drawing of the clock
face and the hands. Contains a reference to an NXImage
object which holds the rendered image of the clock face.
This object is composited into the window and then the
hands are drawn atop at each clock tick.
ClockViewWraps.psw - Wraps for drawing the clock face, detecting a hit on
the alarm hand and defining objects in the server.
Topics of interest from the Clock application:
Using a static user path description (ClockView)
Defining user objects (ClockView)
Defining graphic state objects (ClockView)
Drawing into an offscreen window and compositing from it (ClockView)
Scaling the Clock (ClockView)